<?php
namespace app\admin\validate\User;
use bang\validate\Validate;

/**
 * Customer验证模型
 * Class CustomerValidate
 * @package app\admin\validate\User
 */
class CustomerValidate extends Validate
{
    protected $rule =   [
        'pid'  => 'number',
        'group_id'  => 'number',
        'username'  => 'require|max:50',
        'password'  => 'require|max:32',
        'name'  => 'require|max:150',
        'email'   => 'email',
        'mobile'   => 'mobile',
        'avatar'   => 'max:255',
        'birthday'   => 'date',
        'gender'   => 'in:0,1,2',
        'score'   => 'float|egt:0',
        'status'   => 'require|in:0,1',
    ];

    protected $message  =   [

    ];


    protected $scene = [
        'add'  =>  ['pid' , 'group_id' , 'username' , 'password' , 'name' , 'email' , 'mobile' , 'avatar' , 'birthday' , 'gender' , 'score' , 'status'],
        'edit'  =>  ['pid' , 'group_id'  , 'password' , 'name' , 'email' , 'mobile' , 'avatar' , 'birthday' , 'gender' , 'score' , 'status'],
    ];
}